# # TODO 加减法
# a = 19
# b = 3
# print(a+b)   #输出a和b和
#  #减法
#  print(a-b)
#  #乘法
#  print(a * b)
#  #除法
#  print(a/b)
#  #取整
#  print(a//b)
#  #取余
#  print(a % b)
#  #幂
#  print(a ** b)


# TODO 赋值运算
# a=18
# b=6
# #a+=b    a=a+b
# #a-=b    a=a-b
# #a*=b    a=a*b
# #a/=b    a=a/b
# #a%=b    a=a%b
# #a//=b    a=a//b
# #a**=b    a=a**b

 #TODO 身份运算符
# a = 15
# b = 15
# print (a == b) # 比较值大小
# print (id(a) == id(b))   #比较身份
# print (a is b)   #比较身份
# print (a is not b)

# 字符串比较

# str1 = '我好帅'
# str2 = '我好帅'
# print(str1 == str2)
# print(id(str1) == id(str2))
# print(str1 is str2)
# print(str1 is not str2)

#列表比较
# a = [1,2,3]
# b = [1,2,3]
# print(a == b)
# print(id(a) == id(b))
# print(a is b)
# print(a is not b)

# TODO 逻辑运算符
# # and or not
# a = True
# b = False
# print(a and b)
# print(a or b)
# print(not a)
# print(not b)

# x = 1
# y = 0
# print(x and y)
# print(x or y)
# print(not x)
# print(not y)

#案例 #去网吧上网 满18岁,带身份证
# age = 15
# id_card = True
# print(age>=18 and id_card)

#优先级 先乘除后加减
# print(5+6*3)
# print((5+3)*3)

# TODO 比较符运算
# a = 13
# b = 7
#
# # a和b比较大小
# print(a == b)
# # a不等于b
# print(a !=b )
# #a > b
# print(a > b)
# #a < b
# print(a < b)
# #a>=b
# print(a >= b)
# #a <= b
# print(a <= b)

# TODO 字符的类型转换  int  float str bool

# #int转float
# num1 = 15
# print(float(num1))
# print(type(num1), num1)

#int转str
# num2 = 19
# print(str(num2))
# print(type(num2), num2)

# int转 bool
# num3 = 0
# print(bool(num3))
# print(type(num3), num3)

#float转 int
# float1 = 13.5
# print(int(float1))
# print(type (int(float1)), float1)

#str转 int
# str1 = '3'
# print(int(str1))
# print(type (int(str1)), str1)

#str转bool
# str2 = '1'
# print(bool(str2))

#str转 float
# str3 = '3'
# print(float(str3))
# print(type(str3), str3)

# todo 变量格式化输出

# %s %d %f  占位符

# name = '张三'
# age = 26
# height = 172.6

# print("我的名字是:",name)
# print("我的年龄是:",age)
# print("我的身高是:",height)
#
# print("我的名字是:",name,"我的年龄是:",age,"我的身高是:",height)
# print('我的名字是:%s,我的年龄是:%d,我的身高是:%f' % (name,age,height))
#
# print("我的名字是:%s" % name)
# print("我的身高是:%.2f" % height)
# print("我的年龄是:%d" % age)

# num1 = 10
# num = 321
# print('身高%05d'% num1)
#
# # TODO 不同类型之间的运算
# num1 = 12
# num2 = 15.2
# print(num1 * num2)
#
# # str1 = ('hello')
# # str2 = ('python')
# # print(str1 + str2)
# #
# # print(str1 * 3)


# TODO 转义符

# \ 表示转义
# \n 表示换行
# \t 转义tab键 四个空格等于一个tab
# \r 不要前面的内容
#前面加人 表示输出原本的内容
#
# print('hello\npython') #换行
# print(r'hello\npython')#输出全部内容
# print('hello\tpython')#空四个空格
# print('hello\rpython')# 保留后面的内容
#

# TODO if 控制语句
#去网吧上网案例
# has_card = True
# age = 17
# if age >=18 and has_card:
#     print('可以上网')
# else:
#     print('滚回家')

#求 给成绩归类 大于90为A 大于80为B  大于70位C 大于60为E  小于60为E
score = int(input('请输入成绩:'))
if score >= 90 :
    print('等级A')
elif score >= 80 :
    print('等级B')
elif score >= 70:
    print('等级C')
elif score >= 60:
    print('等级D')
else:
    print('等级E')

has_ticket = True
knife_length = 12
if knife_length <= 20:
    print('安检通过，请前往检票!')
    if has_ticket:
        print('通过，请上车!')
    else:
        print('检票失败，不通过!')
else:
    print(f'警告！携带刀的长度为:{knife_length}cm，大于20cm，请退出!')
    print('警告！携带刀的长度为:%scm，大于20cm，请退出!' % knife_length)




